package com.demo;

public class Method3Demo {
    public static void main(String[] args) {
        System.out.println(compare(20,10));
        System.out.println(compare((short) 20,(short)20));
        System.out.println(compare(5.0,5.0));
    }
    //定义方法比较两个数是否相等
    public static boolean compare(int a,int b){
        System.out.println("int");
        return a == b;
    }

    public static boolean compare(long a,long b){
        System.out.println("long");
        return a==b;
    }

    public static boolean compare(short a,short b){
        System.out.println("short");
        return a==b;
    }

    public static boolean compare(byte a,byte b){
        System.out.println("byte");
        return a==b;
    }
    public static boolean compare(double a,double b){
        System.out.println("double");
        return a==b;
    }
}
